
<?php $this->headScript()->appendFile($this->publicUrl . "Scripts/formsValidation.js"); ?>
<?php $this->headScript()->captureStart(); ?>
function validateProductForm() {
	var validator = new FormValidator('product');	
	validator.isNotEmpty('product[price]', '<?= $this->translate('isEmpty') ?>');
	validator.isRealNumber('product[price]', "<?= $this->validationMessage('notFloat') ?>");
	validator.isNotEmpty('texts[name]', '<?= $this->translate('isEmpty') ?>');
	validator.isNotEmpty('texts[description]', '<?= $this->translate('isEmpty') ?>');	
	return validator.result;
}
<?php $this->headScript()->captureEnd(); ?>


<h2><?= $this->translate("AddProduct") ?></h2>

<?php $this->form->setAttrib('onsubmit', 'return validateProductForm();') ?>
<?= $this->form ?>

<!-- Pro testovani uploadu souboru. 
<form method="post" action="/demo2/index.php/Admin/Products/add-product">
	<input type="file" name="soubor"/>
	<input type="submit"/>
</form>
 -->